package com.mission.game.creategame;

import android.view.View;
import android.widget.EditText;

import com.mission.game.R;
import com.mission.game.utils.Task;
import com.mission.game.utils.TextTask;

public class CreateTextTask extends CreateAbstractTask {

	@Override
	protected Task newSpecificTask() {
		return new TextTask();
	}

	@Override
	protected int getDescriptionInput() {
		return R.id.text_description_input;
	}

	@Override
	protected int getNameInput() {
		return R.id.texttask_name_input;
	}

	@Override
	protected int getContentView() {
		return R.layout.create_text_task;
	}

	@Override
	protected void setFields() {
		super.setFields();
		((EditText) findViewById(R.id.text_answer_input))
				.setText(((TextTask) _task).getCorrectAnswer());
	}

	@Override
	protected void specificBackToMissionClicked(View v) {
		((TextTask) _task)
				.setCorrectAnswer(((EditText) findViewById(R.id.text_answer_input))
						.getText().toString());
	}

	@Override
	protected int getScoreInput() {
		return R.id.text_score_input;
	}

}
